const colorConf = [
  {
    "name": "recent color",
    "enName": "最近使用",
    "color": JSON.parse(localStorage.chromeToolCdyColorConf || `{"recentConf": []}`).recentConf
  },
  {
    "name": "achromatic color",
    "enName": "无彩色",
    "color": {
      "bright_6": "#333",
      "bright_5": "#666",
      "bright_4": "rgba(255,16,16,.8)",
    }
  }, {
    "name": "Dust Red",
    "enName": "薄暮",
    "color": {
      "bright_5": "#fff1f0",
      "bright_4": "#ffccc7",
      "bright_3": "#ffa39e",
      "bright_2": "#ff7875",
      "bright_1": "#ff4d4f",
      "common": "#f5222d",
      "dark_1": "#cf1322",
      "dark_2": "#a8071a",
      "dark_3": "#820014",
      "dark_4": "#5c0011"
    }
  }, {
    "name": "Volcano",
    "enName": "火山",
    "color": {
      "bright_5": "#fff2e8",
      "bright_4": "#ffd8bf",
      "bright_3": "#ffbb96",
      "bright_2": "#ff9c6e",
      "bright_1": "#ff7a45",
      "common": "#fa541c",
      "dark_1": "#d4380d",
      "dark_2": "#ad2102",
      "dark_3": "#871400",
      "dark_4": "#610b00"
    }
  }, {
    "name": "Sunset Orange",
    "enName": "日暮",
    "color": {
      "bright_5": "#fff7e6",
      "bright_4": "#ffe7ba",
      "bright_3": "#ffd591",
      "bright_2": "#ffc069",
      "bright_1": "#ffa940",
      "common": "#fa8c16",
      "dark_1": "#d46b08",
      "dark_2": "#ad4e00",
      "dark_3": "#873800",
      "dark_4": "#612500"
    }
  }, {
    "name": "Calendula Gold",
    "enName": "金盏花",
    "color": {
      "bright_5": "#fffbe6",
      "bright_4": "#fff1b8",
      "bright_3": "#ffe58f",
      "bright_2": "#ffd666",
      "bright_1": "#ffc53d",
      "common": "#faad14",
      "dark_1": "#d48806",
      "dark_2": "#ad6800",
      "dark_3": "#874d00",
      "dark_4": "#613400"
    }
  }, {
    "name": "Sunrise Yellow",
    "enName": "日出",
    "color": {
      "bright_5": "#feffe6",
      "bright_4": "#ffffb8",
      "bright_3": "#fffb8f",
      "bright_2": "#fff566",
      "bright_1": "#ffec3d",
      "common": "#fadb14",
      "dark_1": "#d4b106",
      "dark_2": "#ad8b00",
      "dark_3": "#876800",
      "dark_4": "#614700"
    }
  }, {
    "name": "Lime",
    "enName": "青柠",
    "color": {
      "bright_5": "#fcffe6",
      "bright_4": "#f4ffb8",
      "bright_3": "#eaff8f",
      "bright_2": "#d3f261",
      "bright_1": "#bae637",
      "common": "#a0d911",
      "dark_1": "#7cb305",
      "dark_2": "#5b8c00",
      "dark_3": "#3f6600",
      "dark_4": "#254000"
    }
  }, {
    "name": "Polar Green",
    "enName": "极光绿",
    "color": {
      "bright_5": "#f6ffed",
      "bright_4": "#d9f7be",
      "bright_3": "#b7eb8f",
      "bright_2": "#95de64",
      "bright_1": "#73d13d",
      "common": "#52c41a",
      "dark_1": "#389e0d",
      "dark_2": "#237804",
      "dark_3": "#135200",
      "dark_4": "#092b00"
    }
  }, {
    "name": "Cyan",
    "enName": "明青",
    "color": {
      "bright_5": "#e6fffb",
      "bright_4": "#b5f5ec",
      "bright_3": "#87e8de",
      "bright_2": "#5cdbd3",
      "bright_1": "#36cfc9",
      "common": "#13c2c2",
      "dark_1": "#08979c",
      "dark_2": "#006d75",
      "dark_3": "#00474f",
      "dark_4": "#002329"
    }
  }, {
    "name": "Daybreak Blue",
    "enName": "拂晓蓝",
    "color": {
      "bright_5": "#e6f7ff",
      "bright_4": "#bae7ff",
      "bright_3": "#91d5ff",
      "bright_2": "#69c0ff",
      "bright_1": "#40a9ff",
      "common": "#1890ff",
      "dark_1": "#096dd9",
      "dark_2": "#0050b3",
      "dark_3": "#003a8c",
      "dark_4": "#002766"
    }
  }, {
    "name": "Geek Blue",
    "enName": "极客蓝",
    "color": {
      "bright_5": "#f0f5ff",
      "bright_4": "#d6e4ff",
      "bright_3": "#adc6ff",
      "bright_2": "#85a5ff",
      "bright_1": "#597ef7",
      "common": "#2f54eb",
      "dark_1": "#1d39c4",
      "dark_2": "#10239e",
      "dark_3": "#061178",
      "dark_4": "#030852"
    }
  }, {
    "name": "Golden Purple",
    "enName": "酱紫",
    "color": {
      "bright_5": "#f9f0ff",
      "bright_4": "#efdbff",
      "bright_3": "#d3adf7",
      "bright_2": "#b37feb",
      "bright_1": "#9254de",
      "common": "#722ed1",
      "dark_1": "#531dab",
      "dark_2": "#391085",
      "dark_3": "#22075e",
      "dark_4": "#120338"
    }
  }, {
    "name": "Magenta",
    "enName": "法式洋红",
    "color": {
      "bright_5": "#fff0f6",
      "bright_4": "#ffd6e7",
      "bright_3": "#ffadd2",
      "bright_2": "#ff85c0",
      "bright_1": "#f759ab",
      "common": "#eb2f96",
      "dark_1": "#c41d7f",
      "dark_2": "#9e1068",
      "dark_3": "#780650",
      "dark_4": "#520339"
    }
  }
];
colorConf.setRecentColor = function (color) {
  if (!color) return;
  const list = colorConf[0].color;
  const index = list.indexOf(color);
  if (index + 1) list.splice(index, 1);
  list.unshift(color);
  if (list.length > 10) colorConf[0].color = list.slice(0,10);
  localStorage.chromeToolCdyColorConf = JSON.stringify({recentConf: colorConf[0].color})
};
colorConf.getColor = function(path){
  try {
    return eval(path);
  } catch (e) {
    return "";
  }
};
export default colorConf;
